package com.vrv.app.cyberspace.common.ddio;

import com.vrv.app.cyberspace.modules.sys.entity.UserTable;

/**
 * @Author：LJ
 * @Description：
 * @Date: 2017/12/23
 * @Modified By:
 */
public class DDIOUser {
    private String userID;

    /**
     * 姓名
     */
    private String name;
    /**
     * 真实姓名
     */
    private String realname;

    /**
     * 手机号
     */
    private String phoneNum;
    /**
     * 电话号码清单
     */
    private String[] phoneNums;

    /**
     * 角色ID
     */
    private Integer roleID;

    /**
     * 组织结构id,多个用逗号分隔
     */
    private String orgID;

    /**
     * 企业扩展信息
     */
    private String entExtend;

    /**
     * 原始头像url
     */
    private String oriPortraitURL;
    /**
     * 头像
     */
    private String portraitURL;


    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRealname() {
        return realname == null ? name : realname;
    }

    public void setRealname(String realname) {
        this.realname = realname;
    }

    public String getPhoneNum() {
        return phoneNum;
    }

    public void setPhoneNum(String phoneNum) {
        this.phoneNum = phoneNum;
    }

    public String[] getPhoneNums() {
        return phoneNums;
    }

    public void setPhoneNums(String[] phoneNums) {
        this.phoneNums = phoneNums;
    }

    public Integer getRoleID() {
        return roleID;
    }

    public void setRoleID(Integer roleID) {
        this.roleID = roleID;
    }

    public String getOrgID() {
        return orgID;
    }

    public void setOrgID(String orgID) {
        this.orgID = orgID;
    }

    public String getEntExtend() {
        return entExtend;
    }

    public void setEntExtend(String entExtend) {
        this.entExtend = entExtend;
    }

    public String getOriPortraitURL() {
        return oriPortraitURL;
    }

    public void setOriPortraitURL(String oriPortraitURL) {
        this.oriPortraitURL = oriPortraitURL;
    }

    public String getPortraitURL() {
        return portraitURL;
    }

    public void setPortraitURL(String portraitURL) {
        this.portraitURL = portraitURL;
    }

    public UserTable createUserTable(String serverUrl) {
        UserTable userTable = new UserTable();
        userTable.setLinkdoodID(getUserID());
        userTable.setLinkdoodName(getRealname());
        userTable.setPhotoUrl(getPortraitURL() == null ? null : serverUrl + "/" + getPortraitURL());
        userTable.setCellphone(getPhoneNum());
        userTable.setOrgID(getOrgID() == null ? "1" : getOrgID());
        userTable.setRoleID(getRoleID());
        return userTable;
    }
}
